package com.moneytalks.blazepoc.services.responders {
	import com.moneytalks.blazepoc.dto.UserDto;
	import com.moneytalks.blazepoc.models.ApplicationModel;
	
	import mx.rpc.IResponder;
	import mx.rpc.events.ResultEvent;

	public class AuthenticationResponder implements IResponder {
		private var appModel:ApplicationModel;
		public function AuthenticationResponder(model:ApplicationModel) {
			appModel = model;
		}

		public function result(data:Object):void {
			var re:ResultEvent = data as ResultEvent;
			appModel.user = re.result as UserDto;
		}

		public function fault(info:Object):void{
			appModel.userMessage = "Invalid credentials, please try again";
		}
	}
}